package nio;

import java.nio.IntBuffer;
import java.util.Arrays;

/**
 * @Author Klys
 * @Date 2023/6/3 11:01
 * @Description
 * @Version 1.0
 */
public class Demo07 {

    public static void main(String[] args) {
        IntBuffer buffer = IntBuffer.wrap(new int[]{1, 2, 3, 4, 5});
        int[] arr = new int[10];
        System.out.println(arr);
        System.out.println(buffer.get());
        System.out.println(buffer);
        System.out.println(Arrays.toString(buffer.array()));
        //offset必须为get后的posation
        buffer.get(arr, 1, 4);
        System.out.println(buffer);
        System.out.println(Arrays.toString(buffer.array()));

        System.out.println(Arrays.toString(arr));
    }
}
